<script setup>
// TODO: 编辑
import { ref ,inject, onMounted} from 'vue'

// 弹框开关
const dialogVisible = ref(false)
const rule=ref({
  name:[
    {required:true,message:'要添加',trigger:true}
  ],
  place:[
    {required:true,message:'要添加',trigger:true}
  ],
})
const open=()=>{
  dialogVisible.value=true
}
const close=()=>{
  dialogVisible.value=false
}
const submitA=defineEmits('submit')
const submit=()=>{
  submitA('submitA',)
}

defineExpose({
  open,
  close
})

defineProps({
  dialogList:{
    type:Array
  }
})
</script>

<template>
  <el-dialog v-model="dialogVisible" title="编辑" width="400px">
    <el-form label-width="60px" :data="dialogList" :rules="rule">
      <el-form-item label="姓名" prop="name">
        <el-input placeholder="请输入姓名"  v-model="dialogList.name"/>
      </el-form-item>
      <el-form-item label="籍贯" prop="place">
        <el-input placeholder="请输入籍贯" v-model="dialogList.place"/>
      </el-form-item>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="submit" >确认</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<style scoped>
.el-input {
  width: 290px;
}
</style>
